#!/usr/local/cdat5.2/bin/cdat
# Import the modules needed for the tuturial
import vcs, cdms2, cdutil, time, os, sys
import vcsaddons.current_isotherm as isotherm


i=isotherm.Isotherm()
path=i.make_current_isotherm()


filepath = os.path.join(sys.prefix, 'sample_data/iso.nc')


cdmsfile = cdms2.open( filepath )

# Initial VCS:
v = vcs.init()


df_asd = v.getisoline( 'ASD' )

df_asd.linecolors=(16,100,200)
# view the level labels
df_asd.label='yes'


data = cdmsfile('clt', longitude=(60, 100), latitude = (5., 40.))# for india region over world
v.plot( data, df_asd,continents=6 ) # 4 for default world continent
print "Press the Return key to see next plot."
path=path+"india_isoline"
v.png(path)
#path is "/usr/local/cdat5.2/lib/python2.5/site-packages/isotherm_data/india_isoline"

#uncomment the following line if you are using cdat python2.6
#i.gmail('myusername@gmail.com','password',to_mail_ids=['tarulalan@gmail.com'],subject='Isolines on India sent by vcsaddon.Isotherm',body='Hai')


'''
i.gamil() the arguments are optional when you give user and password inside "current_isotherm.py"  Email class  640 th line.
And you can write send_to_mail under "isotherm_data/to_mails"
And you can write subject under "isotherm_data/subject"
And you can write body under "isotherm_data/body"

'''


print "Good bye!\n\n\n"
